/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Teste_2.java
 *
 * Created on 28/06/2011, 16:42:34
 */

package Testes;

import java.util.Locale;
import java.util.ResourceBundle;

/**
 *
 * @author pc
 */
public class Teste_2 extends javax.swing.JFrame {

    //private static ResourceBundle myResources =
         //   ResourceBundle.getBundle("Testes/messages_teste", Locale.getDefault());

    /** Creates new form Teste_2 */
    public Teste_2() {
        Locale.getDefault();
        System.out.println(Locale.getDefault());

        if(Locale.getDefault().toString().equalsIgnoreCase("pt_BR"))
        {
            language = "Testes/messages";
        }else if(Locale.getDefault().toString().equalsIgnoreCase("en_US"))
        {
            language = "Testes/messages_en_US";
        }

        System.out.println(language);
        initComponents();

        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        setLocationRelativeTo(null);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setText(java.util.ResourceBundle.getBundle(language).getString("test2.label.frase"));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(169, 169, 169)
                .addComponent(jLabel1)
                .addContainerGap(97, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(85, 85, 85)
                .addComponent(jLabel1)
                .addContainerGap(200, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    /*public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Teste_2().setVisible(true);
            }
        });
    }*/

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
    private String language;
}
